package com.zy.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zy.system.mapper.SysUserPostMapper;
import com.zy.system.domain.SysUserPost;
import com.zy.system.service.ISysUserPostService;
import com.zy.common.support.Convert;

/**
 * 用户与岗位关联 服务层实现
 * 
 * @author zy
 * @date 2018-12-19
 */
@Service
public class SysUserPostServiceImpl implements ISysUserPostService 
{
	@Autowired
	private SysUserPostMapper sysUserPostMapper;

	/**
     * 查询用户与岗位关联信息
     * 
     * @param userId 用户与岗位关联ID
     * @return 用户与岗位关联信息
     */
    @Override
	public SysUserPost selectSysUserPostById(Integer userId)
	{
	    return sysUserPostMapper.selectSysUserPostById(userId);
	}
	
	/**
     * 查询用户与岗位关联列表
     * 
     * @param sysUserPost 用户与岗位关联信息
     * @return 用户与岗位关联集合
     */
	@Override
	public List<SysUserPost> selectSysUserPostList(SysUserPost sysUserPost)
	{
	    return sysUserPostMapper.selectSysUserPostList(sysUserPost);
	}
	
    /**
     * 新增用户与岗位关联
     * 
     * @param sysUserPost 用户与岗位关联信息
     * @return 结果
     */
	@Override
	public int insertSysUserPost(SysUserPost sysUserPost)
	{
	    return sysUserPostMapper.insertSysUserPost(sysUserPost);
	}
	
	/**
     * 修改用户与岗位关联
     * 
     * @param sysUserPost 用户与岗位关联信息
     * @return 结果
     */
	@Override
	public int updateSysUserPost(SysUserPost sysUserPost)
	{
	    return sysUserPostMapper.updateSysUserPost(sysUserPost);
	}

	/**
     * 删除用户与岗位关联对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteSysUserPostByIds(String ids)
	{
		return sysUserPostMapper.deleteSysUserPostByIds(Convert.toStrArray(ids));
	}
	
}
